package com.finance.scheduler.thread;

import com.finance.scheduler.requestxml.PullDataRequest;
import com.finance.scheduler.service.LogisticsDataPuller;
import com.finance.scheduler.service.PullResult;

import java.util.concurrent.Callable;

/**
 * 线程拉单
 * Created by CBWL on 2017/6/7.
 */
public class PullCallable implements Callable<PullResult> {

    private PullDataRequest pullDataRequest;

    private LogisticsDataPuller logisticsDataPuller;

    public PullCallable(LogisticsDataPuller logisticsDataPuller, PullDataRequest pullDataRequest){
        this.logisticsDataPuller = logisticsDataPuller;
        this.pullDataRequest = pullDataRequest;
    }
    @Override
    public PullResult call() throws Exception {
        PullResult result = this.logisticsDataPuller.pullLogistic(pullDataRequest);
        return result;
    }
}
